const M = require("mockjs");


M.Random.extend({
	rolesGroup: ["03-02-02", "03-02-03", "03-03", "03-04-02", "03-04-03", "03-05", "calendar", "05", "06", "07", "08", "09", "10"],
	//自定义占位符名字tags
	roles(date) {
		//随机选择 2 个作为返回值
		// return this.pick(this.rolesGroup, 2);
		//随机选择 8~10 个作为返回值
		return this.pick(this.rolesGroup, 8, 10);
	},
});

const getInfo = M.mock({
	id: "@id()",
	name: "@cname()",
	avatar: "@image('100x100','#02adea','#000','avatar')",
	description: "@paragraph()",
	email: "@email()",
	// roles: "@roles",
	roles: "['admin']",
});



M.mock("/dev-api/get-info", "post", () => {
	return getInfo;
});

M.mock("/dev-api/logout", "post", () => {
	return "退出登录";
});
